package me.zxk.qwert_poetry.dto;

import lombok.Data;
import me.zxk.qwert_poetry.dao.User;

@Data
public class SimpleUserDTO {
    private Integer id;
    private String nickname;
    private String phoneNumber;
    private String role;
    private String email;

    public static SimpleUserDTO fromEntity(User user) {
        SimpleUserDTO dto = new SimpleUserDTO();
        dto.setId(user.getId());
        dto.setNickname(user.getNickname());
        dto.setPhoneNumber(user.getPhoneNumber());
        dto.setRole(user.getRole());
        dto.setEmail(user.getEmail());
        return dto;
    }
}
